package com.keray.common.entity;

import java.io.Serializable;

/**
 * @author by keray
 * date:2020/7/15 9:39 上午
 */
public interface IBSEntity<T extends IBSEntity<T, ID>, ID extends Serializable> extends IBEntity<T> {
    ID getId();

    void setId(ID id);

    default Class<?> idClazz() {
        Class<?> clazz = this.getClass();
        try {
            return clazz.getMethod("getId").getReturnType();
        } catch (NoSuchMethodException ignore) {
            throw new RuntimeException();
        }
    }
}
